ST_REF_DIR="C:/Program Files/Zone Five Software/SportTracks 2.0"

# 
TAR=zip
CC="c:/WINDOWS/Microsoft.NET/Framework/v3.5/csc.exe"
CFLAGS=/target:library /reference:$(ST_REF_DIR)/Common.Data.dll /reference:$(ST_REF_DIR)/Common.Visuals.dll

SVNREV=$(shell svnversion -n ./)
VERSION=0.0.$(SVNREV)
PROJECTNAME=HDPlugin
OUTFILE_PREFIX=$(PROJECTNAME)_0.0.$(SVNREV)
OUTFILE_DLL=$(PROJECTNAME).dll
OUTFILE_ST2=$(OUTFILE_PREFIX).st2plugin
OUTFLAG=/out:$(OUTFILE_DLL)

SOURCES=$(wildcard *.cs)

all: hdplugin

hdplugin: $(SOURCES)
	sed -e 's/VERSION/$(VERSION)/g' AssemblyInfo.template > AssemblyInfo.cs
	$(CC) $(CFLAGS) $(REFERENCES) $(OUTFLAG) $(SOURCES) AssemblyInfo.cs
	$(TAR) $(OUTFILE_ST2) $(OUTFILE_DLL) plugin.xml
